# Contributor: Feng Shu <tumashu@163.com>

_realname=rime-bopomofo
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.0.0.20210131
_commit=c7618f4f5728e1634417e9d02ea50d82b71956ab
pkgrel=1
pkgdesc="Bopomofo input for rime (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/rime/rime-bopomofo"
license=('LGPL')
# Rime will regenerate yaml&prism bin, which makes terra-pinyin required on runtime (for translator)
# rime-cangjie is dependency for reverse lookup
depends=("${MINGW_PACKAGE_PREFIX}-rime-cangjie"
         "${MINGW_PACKAGE_PREFIX}-rime-terra-pinyin")
source=("https://github.com/rime/rime-bopomofo/archive/${_commit}/rime-bopomofo-${_commit}.tar.gz")
sha512sums=('106a2897ac409b12e5a9aee35bed31e6bd76e4c2cb5caed5d201e03891b316fe42e279c72e5a3b06fe575ea2e897903986fcab9401933b7dfc4d47064be01bce')

package() {
  cd "rime-bopomofo-${_commit}"
  install -Dm644 *.yaml -t "${pkgdir}${MINGW_PREFIX}/share/rime-data/"
}
